package com.sproutcat.sample.singleton;

/**
 * 单例模式（枚举的饿汉模式）
 *
 * @author tzg
 */
public enum Singleton3 {
    /**
     *
     */
    INSTANCE;

    public void m() {
        System.out.println("m");
    }

    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            new Thread(() -> System.out.println(Singleton3.INSTANCE.hashCode())).start();
        }
    }

}
